/***********************************************************************************************************
 *** @Author         : jiabao
 *** @Description    :
 *** @Date           : 2023-12-03 12:50:25
 *** @FilePath       : /demo_cc/make/creat_library/src/time.cpp
 ***********************************************************************************************************/
#include <iostream>
#include <chrono>
using namespace std;

void print_now_time()
{
    auto now = chrono::system_clock::now();
    time_t tt = chrono::system_clock::to_time_t(now);
    auto time_tm = localtime(&tt);
    char strTime[25] = {0};
    sprintf(strTime, "%d-%02d-%02d %02d:%02d:%02d", time_tm->tm_year + 1900,
            time_tm->tm_mon + 1, time_tm->tm_mday, time_tm->tm_hour,
            time_tm->tm_min, time_tm->tm_sec);
    cout << strTime << endl;
}